package com.webgis.backendservice.mapper;

import com.webgis.backendservice.pojo.Poi;
import com.webgis.backendservice.pojo.Rate;
import com.webgis.backendservice.pojo.Route;
import com.webgis.backendservice.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface POIMapper {
    @Select("select * from poi")
    List<Poi> getPOI();

    @Select("select * from rate where treeId =#{treeId} ")
    List<Rate> getRateByUser(int treeId);

    @Insert("insert into rate(treeId, time, user, content)" +
            " values(#{treeId},#{time},#{user},#{content})")
    void addRate(Rate rate);

    // 用户自定义导游路线
    @Select("select * from route")
    List<Route> getRoute();

    @Insert("insert into route(lonlat, time)" +
            " values(#{lonlat},#{time})")
    void addRoute(Route route);
}
